package com.gong.DesignPattern.MementoPattern;

import java.util.Stack;

/**
 * @author GongChang
 * @version 1.0
 * @date 2021/7/2 0002 8:53
 */
public class History<T> {
    private Stack<T> stack = new Stack<>();

    public void add(T t){
        stack.push(t);
    }

    public T get(){
        stack.pop();
        return stack.pop();
    }
}
